﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace UI
{
    /// <summary>
    /// WebService1 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class WebService1 : System.Web.Services.WebService
    {
        BLL.BrandBll brandbll = new BLL.BrandBll();
        BLL.GoodsBll goodsbll = new BLL.GoodsBll();
        BLL.GoodsTypeBll goodstypebll = new BLL.GoodsTypeBll();
        BLL.IndentBll identbll = new BLL.IndentBll();
        BLL.PurchaseBll purchasebll = new BLL.PurchaseBll();
        BLL.ShoppingBll shoppingbll = new BLL.ShoppingBll();
        BLL.UserBll userbll = new BLL.UserBll();
        BLL.UserManagerBll usermanagerbll = new BLL.UserManagerBll();
        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }
        [WebMethod]
        public int addshopping(MODEL.Shopping model)
        {
            return shoppingbll.add(model);
        }
        [WebMethod]
        public List<MODEL.Shopping> showshopping()
        {
            return shoppingbll.show();
        }
        [WebMethod]
        public int delshopping(int id)
        {
            return shoppingbll.del(id);
        }
        [WebMethod]
        public int delallshopping(string id)
        {
            return shoppingbll.delall(id);
        }
        [WebMethod]
        ///查询商品
        public List<MODEL.Shopping>shopping()
        {
            return identbll.shopping();
        }
        [WebMethod]
        ///销售的订单明细
        public List<MODEL.Indent> IndentShow(int pageindex, int pagesize, out int count, string name)
        {
            return identbll.IndentShow(pageindex, pagesize, out count, name);
        }
          [WebMethod]
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
       
        public int userReegister(MODEL.User m)
        {
            return userbll.userReegister(m);
        }
     
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        [WebMethod]
        public int userLogin(MODEL.User m)
        {
            return userbll.userLogin(m);
        }


        [WebMethod]
        /// <summary>
        /// 查询密码
        /// </summary>
        /// <param name="email"></param>
        /// <returns></returns>
        public int userselid(string upwd)
        {
            return userbll.userselid(upwd);
        }
        [WebMethod]
        /// <summary>
        /// 修改
        /// </summary>
        /// <param name="m"></param>
        /// <returns></returns>
        public int userupdate(MODEL.User m)
        {
            return userbll.userupdate(m);
        }
    }
}
